const seq = require('../db_connect'),
      { STRING, INT, TEXT, DECIMAL } = require('../../configs/db_type');

const CourseCollection = seq.define('course_collection', {
  cid: {
    comment: 'Course_ID',
    type: 'INT',
    allowNull: false,
    unique: true
  },
  title: {
    comment: 'Collection_title',
    type: STRING,
    allowNull: false
  },
  info: {
    comment: 'Collection_infomation',
    type: STRING,
    allowNull: false
  },
  qqQunLink: {
    comment: 'The_link_to_open_QQ_commuication', 
    type: STRING,
    allowNull: false
  },
  posterUrl: {
    comment: 'Poster_image_url',
    type: STRING,
    allowNull: false
  },
  courseIdList: {
    comment: 'The_collection_for_containing_course_IDs',
    type: STRING,
    allowNull: false
  },
  posterKey: {
    comment: 'Qiniu_poster_image_url',
    type: STRING,
    allowNull: false
  },
  status: {
    comment: 'course_collection_status', //控制是否显示
    type: INT,
    defaultValue: 1,
    allowNull: true //设初始值要同时设置非空
  }
})

module.exports = CourseCollection;